let owObj = {}
async function getInfo(usernum) {
	let that = this
	const v = await getUlists(usernum)
	return new Promise((resolve, reject) => {
		resolve(owObj ? owObj : {"name": "娄宇","ewm1":"http://hlj.offcn.com/zg/lynn/img/1.png", "ewm2": "http://hlj.offcn.com/zg/lynn/img/d1.png"});
	})
}

function getUlists(usernum){
	return new Promise((resolve, reject) => {
		uni.request({
			url: 'https://hlj.offcn.com/zg/lynn/userList.js',
			method: 'get',
			dataType: 'json',
			async: false,
			data: {ssitems: new Date()},
			success: function(res) {
				filterInfo(res.data,usernum)
				resolve(owObj);
			}
		});
	})
	
}

function filterInfo(list,usernum){
	let pInfo = {}
	pInfo = list.filter((item,index) => item.name == usernum)
	owObj = pInfo[0]
}


export default {
  getInfo,
  getUlists,
  filterInfo
}
